Touching and Containing
QuickDraw GX allows you to determine if the area enclosed by the contours of one shape touch the area enclosed by the contours of another shape. You can also determine if one shape's area contains the area of another shape.In particular, you can
Figure 4-12 shows the results of testing to see whether pairs of different geometric shapes touch. In this figure, a solid rectangle shape is tested for touching with both a framed path and a solid path, and a solid path is tested for touching with a solid polygon.
- determine if a point touches the area enclosed by a rectangle
- determine if the area enclosed by the contours of a shape touches the area enclosed by a rectangle
- determine if the areas of two shapes touch
Figure 4-12 [Missing image]Testing whether one shape touches another
QuickDraw GX also allows you to determine whether or not
Figure 4-13 shows the results of testing pairs of shapes to see if one shape contains another.
- one rectangle contains another
- a rectangle contains the area covered by a shape
- the area covered by one shape contains the area covered by another shape.
Figure 4-13 Testing whether one shape contains another
Notice the first diagram in the third row of Figure 4-13. A shape does not contain another shape if it merely surrounds the other shape; the area covered by the first shape as drawn must contain the area of the second shape as drawn.
For programming examples of testing shapes for intersection, see "Determining Whether Two Shapes Touch" beginning on page 4-53.
- Note
- QuickDraw GX defines empty shapes as touching no shapes and full shapes as touching any shape except an empty shape. QuickDraw GX also defines full shapes as containing any shape and empty shapes as being contained by any shape except other empty shapes.
![]()
For programming examples of testing shapes for inclusion, see "Determining Whether One Shape Contains Another" beginning on page 4-58.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help